#include "StateLogo.h"
#include "Triangle.h"
#include "Terrain.h"
#include "Skydome.h"

StateLogo::StateLogo()
{
	
}

FWint StateLogo::Init()
{
	FWint err = 0;
	Triangle* triangle = new Triangle;
	err += triangle->Init();
	m_lstEntities.push_back(triangle);
	m_iCount++;
	/*Terrain* terrain = new Terrain();
	err += terrain->Init();
	m_lstEntities.push_back(terrain);
	m_iCount++;
	Skydome * skydome = new Skydome();
	skydome->Init();
	skydome->Scale = Vector3(50000.5f, 50000.5f, 50000.5f);
	m_lstEntities.push_back(skydome);
	m_iCount++;*/
	return err;
}

void StateLogo::Key(const FWobject sender, FWobject extra)
{
	KeyBoard * keyboard = (KeyBoard*)extra;
	if (keyboard->status)
	{
		switch (keyboard->key)
		{
		case 'W':
			Global::CurrentCamera->MoveForward(0.5f);
			break;
		case 'S':
			Global::CurrentCamera->MoveBackward(0.5f);
			break;
		case 'A':
			Global::CurrentCamera->MoveLeft(0.05f);
			break;
		case 'D':
			Global::CurrentCamera->MoveRight(0.05f);
			break;
		case 38:
			Global::CurrentCamera->RotateUp(0.03f);
			break;
		case 40:
			Global::CurrentCamera->RotateDown(0.03f);
			break;
		case 37:
			Global::CurrentCamera->RotateLeft(0.03f);
			break;
		case 39:
			Global::CurrentCamera->RotateRight(0.03f);
			break;
		case 'X':
			MessageService::GetInstance()->SendMessageTag(this, "END_GAME", NULL);
			break;
		default:
			break;
		}
	}
}

void StateLogo::Touch(const FWobject sender, FWobject extra)
{

}